//
// Created by 谢哲 on 2021/5/15.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;

int n;
vector<vector<double>> dp_data;
double dfs(int pos, int remain, vector<bool> &visited, vector<pair<double, double>> &vdata) {
    int sp = 0;
    for (int i=0; i<n; ++i) {
        if (visited[i]) {
            sp += (1 << i);
        }
    }
    if (dp_data[pos][sp] >= 0) return dp_data[pos][sp];
    if (remain <= 1) {
        return 0.0;
    }
    visited[pos] = true;
    double result = 1e9;
    for (int i=0; i<n; ++i) {
        if (visited[i]) continue;
        double cur_dis = sqrt(pow(vdata[i].first-vdata[pos].first, 2)+pow(vdata[i].second-vdata[pos].second, 2));
        result = min(result, cur_dis+dfs(i, remain-1, visited, vdata));
    }
    visited[pos] = false;
    dp_data[pos][sp] = result;
    return result;
}

int main() {
    cin >> n;
    vector<pair<double, double>> vdata(n);
    for (auto &p: vdata) cin >> p.first >> p.second;

    vector<bool> visited(n, false);
    dp_data.resize(16, vector<double>(100000, -1.0));
    double result = 1e9;
    for (int i=0; i<n; ++i) {
        double cur_dis = sqrt(pow(vdata[i].first, 2)+pow(vdata[i].second, 2));
        result = min(result, cur_dis+dfs(i, n, visited, vdata));
    }
    cout << fixed << setprecision(2) << result;

    return 0;
}
